import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Not, Repository } from 'typeorm';
import { Treasury } from './treasury.entity';
import { platFormEnum } from './treasury.enum';

@Injectable()
export class TreasuryService {
  constructor(
    @InjectRepository(Treasury)
    private repository: Repository<Treasury>,
  ) {}

  async save(data: Treasury): Promise<Treasury> {
    return await this.repository.save(data);
  }

  /**
   * 查询用户所有未提现的
   * @param wx_user
   * @returns
   */
  find_By_Platform(platform: platFormEnum): Promise<Treasury> {
    return this.repository.findOne({where:{platform:platform}});
  }

}
